package com.wanho.java157.SystemSetting.controller;

import com.wanho.java157.SystemSetting.po.Department;
import com.wanho.java157.SystemSetting.po.Login;
import com.wanho.java157.SystemSetting.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

import java.util.List;

@Controller
@RequestMapping("/department")
@SessionAttributes({"departments"})
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    @RequestMapping("/departmentCheck")
    public String departmentCheck(Model model){
        List<Department> departments = departmentService.selectAllDepartment();
        model.addAttribute("departments",departments);

        return "redirect:/position/positionCheck";

    }

}
